/*
 * Timer.h
 *
 *  Created on: Oct 16, 2012
 *      Author: travis
 */

#pragma once

#ifdef _WIN32 
#include <windows.h> 
#include "SDL.h"
#else
#include "SDL/SDL.h"
#endif

#include "../LUAscripting/LuaScript.h"

class Timer
{
public:
	Timer();
	virtual ~Timer();

private:
	Uint32 deltaclock;
	Uint32 currentFPS;
	Uint32 startTicks;
	Uint32 lastTimeIntervalCHCK;

public:
	void bindClass(LuaScript::LuaScript * lScript);

	Uint32 update();
	float getDeltaClock();
	unsigned int getDeltaClockMs();

	// return true in time interval
	bool GetInterval(unsigned int interval);
	void resetTimer();
};
